home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
010
/
antdesgn.arc
/
NARRAY.BAS
< prev
next >
Wrap
BASIC Source File
|
1980-01-01
|
2KB
|
85 lines
10 REM PLOT NON-UNIFORM ARRAY FACTOR
20 REM "ANTENNA DESIGN USING PERSONAL COMPUTERS"
30 DIM FLDA(360),IR(30),II(30),Z(30)
40 KEY OFF
50 PI=3.141593
60 DEF FNLOG10(X)=.4343*LOG(X)
70 CLS
80 SCREEN 0,1
90 COLOR 1,0
100 PRINT "THIS PROGRAM COMPUTES THE PATTERN OF A LINEAR ARRAY"
110 PRINT "WITH NONUNIFORM SPACING AND UNEQUAL AMPLITUDES"
120 COLOR 4,0
130 PRINT
140 INPUT "WHAT IS THE FREQUENCY(MHz)";FMC
150 INPUT "HOW MANY ELEMENTS";N
160 IF N<2 THEN GOTO 150
170 REM READ IN SPACING, CURRENT
180 PRINT "TYPE IN THE ELEMENT COORDINATE(meters) AND COMPLEX CURRENT"
190 FOR I=1 TO N
200 PRINT USING "##";I;:INPUT Z(I),IR(I),II(I)
210 NEXT I
220 XK0=2*PI*FMC/300
230 ROD=PI/180
240 REM FILL FLDA WITH FIELD
250 FMAX=0
260 FOR TH=0 TO 180
270 THR=TH*ROD
280 CTH=COS(THR)
290 FR=0
300 FI=0
310 FOR K=1 TO N
320 TT=XK0*Z(K)*CTH
330 AR=COS(TT)
340 AI=SIN(TT)
350 FR=FR+AR*IR(K)-AI*II(K)
360 FI=FI+AR*II(K)+AI*IR(K)
370 NEXT K
380 FLDA(TH)=FR*FR+FI*FI
390 IF FLDA(TH)>FMAX THEN THMAX=TH
400 IF FLDA(TH)>FMAX THEN FMAX=FLDA(TH)
410 NEXT TH
420 REM FILL OTHER HALF OF ARRAY
430 FOR TH=181 TO 360
440 FLDA(TH)=FLDA(360-TH)
450 NEXT TH
460 PRINT
470 REM NORMALIZE DATA
480 FOR TH=0 TO 360
490 FM=FLDA(TH)/FMAX
500 IF FM<.001 THEN FM=.001
510 FLDA(TH)=10*FNLOG10(FM)
520 NEXT TH
530 REM FIND BEAMWIDTH
540 TH=INT(THMAX-.5)
550 TH=TH+1
560 IF FLDA(TH)>-3 THEN GOTO 550
570 TH0=(-3-FLDA(TH-1)+(TH-1)*(FLDA(TH)-FLDA(TH-1)))/(FLDA(TH)-FLDA(TH-1))
580 BW=(TH0-THMAX)*2
590 REM PLOT GRID
600 SCREEN 2,0
610 VIEW (262,20)-(638,188)
620 WINDOW (-1,-1)-(1,1)
630 CIRCLE (0,0),1,,,,.45
640 CIRCLE (0,0),.666,,,,.45
650 CIRCLE (0,0),.333,,,,.45
660 FOR THD=0 TO 150 STEP 30
670 TH=THD*ROD
680 LINE (COS(TH),SIN(TH))-(-COS(TH),-SIN(TH))
690 NEXT THD
700 PSET (FLDA(0)/30+1,0)
710 FOR TH=0 TO 360
720 THR=TH*ROD
730 RAD=FLDA(TH)/30+1
740 LINE -(RAD*COS(THR),RAD*SIN(THR))
750 NEXT TH
760 PRINT USING "SCAN ANGLE=###.# deg.";90-THMAX
770 PRINT USING "3 dB BEAMWIDTH=###.# deg.";BW
780 PRINT "10 dB/DIV."
790 PRINT
800 INPUT "CONTINUE(Y,N)";K$
810 IF K$<>"N" THEN GOTO 70
820 SCREEN 0,1
830 KEY ON
840 END